﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Winz.JsonModel;


namespace Winz.FoeBot
{
    public partial class FormPlayer : Form
    {
        public bool splitterCollapsed = false;
        public DateTime started;
        private DateTime end;
        private Bot bot;
        public OtherPlayeCity city {get;set;}
             

        public FormPlayer()
        {
            InitializeComponent();
            started = DateTime.Now;
            
        }

        public FormPlayer(Bot bot)
            : this()
        {
            this.bot = bot;
            lblInfo.Text = "";
        }
        

        private void timer1_Tick(object sender, EventArgs e)
        {
/*
            end = started.AddSeconds(Bot.settings.waitForUserSelectMotivationDelay);
            if (DateTime.Now > end)
            {
                if (Bot.settings.useDefaultIfNotSet)
                    bot.socialBarMotivator.Motivate(city, Motivator.GetListFromMotivationOrderType(Bot.settings.defaultMotivationOrder));
                else
                    bot.socialBarMotivator.VisitNext(500);

                this.Hide();
            }

            TimeSpan span = end - DateTime.Now;

            string text;
            if (Bot.settings.useDefaultIfNotSet)
                text = "Motivating current player with default ";
            else
                text = "Switching to next player ";
            text += "in " + ((int)(span.TotalSeconds)).ToString() + " s";
            lblInfo.InvokeIfRequired((lbl) => { lbl.Text = text; });
*/        }

        private void btnDefault_Click(object sender, EventArgs e)
        {
            bot.socialBarMotivator.Motivate(city, Motivator.GetListFromMotivationOrderType(Bot.settings.defaultMotivationOrder));
            this.Hide();
        }

        private void btnSkip_Click(object sender, EventArgs e)
        {
            bot.socialBarMotivator.VisitNext(500);
            this.Hide();
        }

    }
}
